package com.ks.vo;


import com.ks.common.Result;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ResponseVO<T> implements Serializable {
    private String requestId;
    private int total;
    private T data;

    public static <T> ResponseVO<T> success(T object, RequestVO requestVO, int total) {
        ResponseVO<T> responseVO = new ResponseVO<T>();
        responseVO.data = object;
        responseVO.requestId = requestVO.getRequestId();
        responseVO.total = total;
        return responseVO;
    }
}
